//
// Created by yyancy on 2019/11/26.
//

#ifndef CPP_EXERCISES_CHRONO_H
#define CPP_EXERCISES_CHRONO_H

enum class Month {
    jan = 1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
};

class Date {
public:
    class Invaild {
    };

    Date();

    int day() const { return d; };

    Month month() const { return m; }

    int year() const { return y; }

    Date(int y, Month m, int d);

    void add_day(int n);

    void add_month(int n);

    void add_year(int n);


private:
    int y, d;
    Month m;

    bool is_valid();
};

bool is_date(int y, Month m, int d);

bool leapyear(int y);


bool operator==(const Date &a, const Date &b);

bool operator!=(const Date &a, const Date &b);

using namespace std;

ostream &operator<<(ostream &os, const Date &dd);

istream &operator>>(istream &is, Date &dd);


void error(std::string string1);


#endif //CPP_EXERCISES_CHRONO_H
